<template>
  <div class="box">
    <h1>App组件</h1>
    <button @click="destoryChild">卸载子组件</button>
    <lieft-cycle class="child" pmsg="我是从爸爸" v-if="flag"></lieft-cycle>
  </div>
  <!-- <todos></todos> -->
</template>

<script>
import LieftCycle from "./components/LieftCycle.vue";
import Todos from "./components/Todos.vue";
export default {
  components: {
    LieftCycle,
    Todos,
  },
  data(){
    return{
      flag:true
    }
  },
  methods:{
    destoryChild(){
      this.flag=false
    }
  }
};
</script>

<style lang="scss">
.box {
  width: 500px;
  height: 600px;
  background-color: red;
  .child {
    width: 300px;
    height: 400px;
    background-color: pink;
  }
}
</style>